package com.crm.service.crm.clue.controller;

import com.crm.model.common.dtos.ResponseResult;
import com.crm.model.crm.clue.dtos.CluePoolDto;
import com.crm.service.crm.clue.service.CluePoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/clue-pool")
public class CluePoolController {

    @Autowired
    private CluePoolService cluePoolService;

    /**
     * 查询线索池以及高级条件搜索
     * @param dto
     * @return
     */
    @PostMapping("/search")
    public ResponseResult cluePoolSearch(@RequestBody CluePoolDto dto){
        return cluePoolService.cluePoolSearch(dto);
    }

    /**
     * 捞取线索
     * @param clueIdName
     * @return
     */
    @PutMapping ("/batch")
    public ResponseResult getAClue(@RequestParam("clueIdName") List<String> clueName ){
        return cluePoolService.getAClue(clueName);
    }
}
